home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
science
/
sm32a.zip
/
LIBRARY
/
PLOTGRID.LI
< prev
next >
Wrap
Text File
|
1994-07-20
|
602b
|
22 lines
# plot(y,x)
# plots a function of y=y(x)
# on xy-plane by default xmin:=-5, xmax:=5, ymin:=-5, ymax:=5
# e.g. plot(sin(x),x)
plotgrid(y_, x_, xmin_, xmax_, ymin_, ymax_) := block(numeric:=on,
graph,
dx:=(xmax-xmin)/getmaxx,
dy:=(ymax-ymin)/getmaxy,
xstep:=dx*10,
grid(xmin,xmax,ymin,ymax),
setcolor(colorno(yellow)),
moveto(0,getmaxy-(subs(y,x=xmin)-ymin)/dy),
do( lineto((x-xmin)/dx,getmaxy-(y-ymin)/dy),
x,xmin,xmax,xstep),
numeric:=off,
readchar,
text,
local(dx,dy,xstep))
plot(y_, x_, xmin_, xmax_) := plot(y,x,xmin,xmax,-5,5)
plot(y_, x_) := plot(y,x,-5,5,-5,5)